home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex / base / tracefnt.sty < prev    next >
Text File  |  1994-12-17  |  8KB  |  256 lines

  1. %% 
  2. %% This is file `tracefnt.sty', generated 
  3. %% on <1994/12/17> with the docstrip utility (2.2i).
  4. %% 
  5. %% The original source files were:
  6. %% 
  7. %% tracefnt.dtx  (with options: `package,trace')
  8. %% 
  9. %% Copyright 1994 the LaTeX3 project and the individual authors. 
  10. %% All rights reserved. For further copyright information see the file 
  11. %% legal.txt, and any other copyright indicated in this file. 
  12. %% 
  13. %% This file is part of the LaTeX2e system. 
  14. %% ---------------------------------------- 
  15. %% 
  16. %% This system is distributed in the hope that it will be useful, 
  17. %% but WITHOUT ANY WARRANTY; without even the implied warranty of 
  18. %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
  19. %% 
  20. %% 
  21. %% IMPORTANT NOTICE: 
  22. %% 
  23. %% For error reports in case of UNCHANGED versions see bugs.txt. 
  24. %% 
  25. %% Please do not request updates from us directly. Distribution is 
  26. %% done through Mail-Servers and TeX organizations. 
  27. %% 
  28. %% You are not allowed to change this file. 
  29. %% 
  30. %% You are allowed to distribute this file under the condition that 
  31. %% it is distributed together with all files mentioned in manifest.txt. 
  32. %% 
  33. %% If you receive only some of these files from someone, complain! 
  34. %% 
  35. %% You are NOT ALLOWED to distribute this file alone. You are NOT 
  36. %% ALLOWED to take money for the distribution or use of either this 
  37. %% file or a changed version, except for a nominal charge for copying 
  38. %% etc. 
  39. \NeedsTeXFormat{LaTeX2e}
  40. \ProvidesPackage{tracefnt}[1994/11/18 v2.3m
  41.                  Standard LaTeX package (font tracing)]
  42. %%% File: tracefnt
  43. %% Copyright (C) 1989-94 by Frank Mittelbach and Rainer Sch\"opf.
  44. %% Copyright (C) 1994 by LaTeX3 project. All rights reserved.
  45. \newcount\tracingfonts
  46. \tracingfonts=0
  47. \DeclareOption{errorshow}{%
  48.    \def\@font@info##1{%
  49.          \GenericInfo{(Font)\@spaces\@spaces\@spaces\space\space}%
  50.                      {LaTeX Font Info: \space\space\space##1}}%
  51.     \def\@font@warning##1{%
  52.          \GenericInfo{(Font)\@spaces\@spaces\@spaces\space\space}%
  53.                         {LaTeX Font Warning: ##1}}%
  54.      }
  55. \DeclareOption{warningshow}{%
  56.    \def\@font@info##1{%
  57.          \GenericInfo{(Font)\@spaces\@spaces\@spaces\space\space}%
  58.                      {LaTeX Font Info: \space\space\space##1}}%
  59.     \def\@font@warning##1{%
  60.          \GenericWarning{(Font)\@spaces\@spaces\@spaces\space\space}%
  61.                         {LaTeX Font Warning: ##1}}%
  62.      }
  63. \DeclareOption{infoshow}{%
  64.    \def\@font@info##1{%
  65.          \GenericWarning{(Font)\@spaces\@spaces\@spaces\space\space}%
  66.                      {LaTeX Font Info: \space\space\space##1}}%
  67.     \def\@font@warning##1{%
  68.          \GenericWarning{(Font)\@spaces\@spaces\@spaces\space\space}%
  69.                         {LaTeX Font Warning: ##1}}%
  70.      }
  71. \DeclareOption{loading}{%
  72.     \tracingfonts\tw@
  73.    }
  74. \DeclareOption{debugshow}{%
  75.     \ExecuteOptions{infoshow}%
  76.     \tracingfonts\thr@@
  77.    }
  78. \DeclareOption{pausing}{%
  79.     \def\@font@warning##1{%
  80.       \GenericError
  81.              {(Font)\@spaces\@spaces\@spaces\space\space}%
  82.              {LaTeX Font Warning: ##1}%
  83.              {See the LaTeX Companion for details.}%
  84.              {I'll stop for every LaTeX Font Warning because
  85.               you requested\\the `pausing' option
  86.               to the tracefnt package.}}%
  87.    }
  88. \ExecuteOptions{infoshow}
  89. \ProcessOptions
  90. \def\extract@font{%
  91.    \get@external@font
  92.    \global\expandafter\font\font@name\external@font\relax
  93.     \ifnum \tracingfonts >\@ne
  94.     \@font@info{External font `\external@font'
  95.               loaded as\MessageBreak \font@name}\fi
  96.     \font@name \relax
  97.     \csname \f@encoding+\f@family\endcsname
  98.     \csname\curr@fontshape\endcsname
  99.     \relax
  100.        }
  101. \DeclareRobustCommand\selectfont
  102.         {%
  103.     \ifx\f@linespread\baselinestretch \else
  104.       \set@fontsize\baselinestretch\f@size\f@baselineskip \fi
  105.     \xdef\font@name{%
  106.       \csname\curr@fontshape/\f@size\endcsname}%
  107.     \pickup@font
  108.     \font@name
  109.     \ifnum \tracingfonts>\tw@
  110.       \@font@info{Switching to \font@name}\fi
  111.     \size@update
  112.     \enc@update
  113.     }
  114. \def\set@fontsize#1#2#3{%
  115.     \@defaultunits\@tempdimb#2pt\relax\@nnil
  116.     \edef\f@size{\strip@pt\@tempdimb}%
  117.     \@defaultunits\@tempskipa#3pt\relax\@nnil
  118.     \edef\f@baselineskip{\the\@tempskipa}%
  119.     \edef\f@linespread{#1}%
  120.     \let\baselinestretch\f@linespread
  121.       \def\size@update{%
  122.         \baselineskip\f@baselineskip\relax
  123.         \baselineskip\f@linespread\baselineskip
  124.         \normalbaselineskip\baselineskip
  125.         \setbox\strutbox\hbox{%
  126.           \vrule\@height.7\baselineskip
  127.                 \@depth.3\baselineskip
  128.                 \@width\z@}%
  129.    \ifnum \tracingfonts>\tw@
  130.       \ifx\f@linespread\@empty
  131.         \let\reserved@a\@empty
  132.       \else
  133.         \def\reserved@a{\f@linespread x}%
  134.       \fi
  135.       \@font@info{Changing size to \f@size/\reserved@a
  136.                 \f@baselineskip}%
  137.       \aftergroup\type@restoreinfo \fi
  138.         \let\size@update\relax}%
  139.   }
  140. \let\size@update\relax
  141.    \def\type@restoreinfo{%
  142.       \ifx\f@linespread\@empty
  143.         \let\reserved@a\@empty
  144.       \else
  145.         \def\reserved@a{\f@linespread x}%
  146.       \fi
  147.       \@font@info{Restoring size to
  148.                 \f@size/\reserved@a\f@baselineskip}}
  149. \def\glb@settings{%
  150.      \expandafter\ifx\csname S@\f@size\endcsname\relax
  151.        \calculate@math@sizes
  152.      \fi
  153.      \csname S@\f@size\endcsname
  154.      \ifmath@fonts
  155.        \ifnum \tracingfonts>\tw@
  156.          \@font@info{Setting up math fonts for
  157.                      \f@size/\f@baselineskip}\fi
  158.        \begingroup
  159.          \escapechar\m@ne
  160.          \csname mv@\math@version \endcsname
  161.          \globaldefs\@ne
  162.          \math@fonts
  163.          \let \glb@currsize \f@size
  164.        \endgroup
  165.         \the\every@math@size
  166.        \else
  167.          \ifnum \tracingfonts>\tw@
  168.            \@font@info{No math setup for
  169.                        \f@size/\f@baselineskip}\fi
  170.      \fi
  171. }
  172.  
  173. \def\check@mathfonts{%
  174.   \ifx \glb@currsize \f@size
  175.     \ifnum \tracingfonts>\thr@@
  176.         \@font@info{*** MATH: no change \f@size\space
  177.          curr/global (\curr@math@size/\glb@currsize)}\fi
  178.   \else
  179.     \ifnum \tracingfonts>\thr@@
  180.         \@font@info{*** MATH: setting up \f@size\space
  181.          curr/global (\curr@math@size/\glb@currsize)}\fi
  182.      \glb@settings
  183.      \if@inmath
  184.        \aftergroup\restglb@settings
  185.      \else
  186.        \ifnum \tracingfonts>\thr@@
  187.         \@font@info{*** MATH: no resetting (not in
  188.                     nested math)}\fi
  189.      \fi
  190.   \fi
  191.   \let\curr@math@size\f@size
  192.   \@inmathtrue
  193. }
  194. \def\restglb@settings{%
  195.     \ifnum \tracingfonts>\thr@@
  196.         \@font@info{*** MATH: restoring}\fi
  197.       \begingroup
  198.         \let\f@size\curr@math@size
  199.         \ifx\glb@currsize \f@size
  200.     \ifnum \tracingfonts>\thr@@
  201.         \@font@info{*** MATH: ... already okay (\f@size)}\fi
  202.         \else
  203.     \ifnum \tracingfonts>\thr@@
  204.         \@font@info{*** MATH: ... to \f@size}\fi
  205.           \glb@settings
  206.         \fi
  207.       \endgroup
  208. }
  209. \def\use@mathgroup#1#2{\relax\ifmmode
  210.   \ifnum \tracingfonts>\tw@
  211.     \count@#2\relax
  212.     \@font@info{Using \noexpand\mathgroup
  213.              (\the\count@) #2}\fi
  214.      \math@bgroup
  215.          \expandafter\ifx\csname M@\f@encoding\endcsname#1\else
  216.          #1\fi
  217.          \mathgroup#2\relax
  218.      \expandafter\math@egroup\fi}%
  219.   \ifx\math@bgroup\begingroup
  220.     \def\math@egroup#1{#1\endgroup
  221.       \ifnum \tracingfonts>\tw@
  222.      \@font@info{Restoring \noexpand\mathgroup
  223.         (\ifnum\mathgroup=\m@ne default\else \the\mathgroup \fi)%
  224.         }\fi}
  225.   \fi
  226. \def\getanddefine@fonts#1#2{%
  227.   \ifnum \tracingfonts>\tw@
  228.   \count@#1\relax
  229.     \@font@info{\noexpand\mathgroup (\the\count@) #1 :=\MessageBreak
  230.               \string#2 \tf@size/\sf@size/\ssf@size}\fi
  231.   \xdef\font@name{\csname \string#2/\tf@size\endcsname}%
  232.   \pickup@font \let\textfont@name\font@name
  233.   \xdef\font@name{\csname \string#2/\sf@size\endcsname}%
  234.   \pickup@font \let\scriptfont@name\font@name
  235.   \xdef\font@name{\csname \string#2/\ssf@size\endcsname}%
  236.   \pickup@font
  237.   \edef\math@fonts{\math@fonts
  238.                \textfont#1\textfont@name
  239.                \scriptfont#1\scriptfont@name
  240.                \scriptscriptfont#1\font@name}%
  241.     }
  242. %% this could be replaced by \try@size@range making the subst slower!
  243. \def\execute@size@function#1{%
  244.          \@ifundefined{s@fct@#1}%
  245.            {\errmessage{Undefined font size function #1}%
  246.             \s@fct@}%
  247.            {\csname s@fct@#1\endcsname}%
  248. }
  249. \def\fontsubfuzz{0pt}
  250. %%\subst@size             %% coded inline
  251. %%\def\subst@size{%
  252. %%}
  253. \endinput
  254. %% 
  255. %% End of file `tracefnt.sty'.
  256.